<div th:replace="~{ app :: layout ('重置密码', _, ~{::#main}, _) }" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity6">
  <div id="main" class="container my-2rem">
    <div class="row justify-content-center">
      <div class="col-lg-8">
        <div class="card">
          <div class="card-header">重置密码</div>

          <div class="card-body">
            <div th:if="${success}" class="alert alert-success"><span th:text="${success}"></span></div>

            <form method="POST" action="#" th:action="@{/user/password-reset}" th:object="${passwordResetEmail}">
              <div class="row mb-3 justify-content-center">
                <div class="col-lg-6">
                  <input placeholder="邮箱" th:field="*{email}" id="email" type="email" class="form-control" th:class="|form-control ${#fields.hasErrors('email') ? 'is-invalid' : ''}|" name="email" required autofocus>
                  <span th:if="${#fields.hasErrors('email')}" class="invalid-feedback" role="alert"><strong th:errors = "*{email}"></strong></span>
                </div>
              </div>

              <div class="row mb-0">
                <div class="col-lg-6 offset-lg-3">
                  <button type="submit" class="btn btn-primary">
                    发送重置密码链接
                  </button>
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>